import request from '@/utils/request'

// 1. 封装接口
export const getComments = (params) => {
  return request({
    method: "GET",
    url: "/comments",
    params
  })
}

// 3. 准备接口
export function addCommentLike(commentId) {
  return request({
    method: "POST",
    url: "/comment/likings",
    data: {
      target: commentId
    }
  })
}

export function deleteCommentLike(commentId) {
  return request({
    method: "DELETE",
    url: `/comment/likings/${commentId}`
  })
}

export function addComment(data) {
  return request({
    method: "POST",
    url: "/comments",
    data
  })
}
